﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace RealNumbersFinderTests
{

    [TestClass()]
    public class RealNumbersFinderTest
    {

        [TestMethod()]
        public void FindNumberInTextTestZero()
        {
            string number = "0";
            string expected = number;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }


        [TestMethod()]
        public void FindNumberInTextTestPositiveInteger()
        {
            string number = "33";
            string expected = number;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }


        [TestMethod()]
        public void FindNumberInTextTestNegativeFloating()
        {
            string number = "-2381.78132";
            string expected = number;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }

        
        [TestMethod()]
        public void FindNumberInTextTestPositiveFloating()
        {
            string number = "4.3347";
            string expected = number;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }


        [TestMethod()]
        public void FindNumberInTextTestAnotherPositiveFloating()
        {
            string number = "12.00";
            string expected = number;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }


        [TestMethod()]
        public void FindNumberInTextTestStartingWithZeroPositiveFloating()
        {
            string number = "0.34";
           string expected = number;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void FindNumberInTextTestStartingWithPlusBeforeInteger()
        {
            string number = "+3";
            string expected = string.Empty;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void FindNumberInTextTestWhiteSpaceBetweenCharacters()
        {
            string number = "24 234";
            string expected = string.Empty;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void FindNumberInTextTestUnnecessaryZeroInfront()
        {
            string number = "01.23";
            string expected = string.Empty;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void FindNumberInTextTestNoDigitsAfterFloatingPoint()
        {
            string number = "12.";
            string expected = string.Empty;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void FindNumberInTextTestWrongSeparator()
        {
            string number = "12,23";
            string expected = string.Empty;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void FindNumberInText2MinusesInfront()
        {
            string number = "--2";
            string expected = string.Empty;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void FindNumberInTextNoDigitsInfrontOfSeparator()
        {
            string number = ".25";
            string expected = string.Empty;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void FindNumberInTextNoDigitsInfrontOfSeparatorAndMinusInfront()
        {
            string number = "-.25";
            string expected = string.Empty;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }


        [TestMethod()]
        public void FindNumberInTextNumberContainingLetters()
        {
            string number = "12e7";
            string expected = string.Empty;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void FindNumberInTextNegativeZero()
        {
            string number = "-0.00";
            string expected = string.Empty;
            string actual;
            actual = RealNumbersFinder.IsNumberReal(number);
            Assert.AreEqual(expected, actual);
        }
    
    }
}
